package com.jing.weibo.service.system;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jing.weibo.mapper.system.RuleMapper;
import com.jing.weibo.pojo.system.Rule;

/**
 * 规则的Service
 * @author jing.yue
 * @version 2012/09/27 1.0.0
 */
@Component
public class RuleService {

	@Autowired
	private RuleMapper ruleMapper;

	/**
	 * 获取所有规则信息集合
	 * @return
	 * @throws Exception
	 */
	public List<Rule> findAllRule() throws Exception {
		// TODO Auto-generated method stub
		return ruleMapper.findAllRule();
	}

	/**
	 * 根据code获取规则对象
	 * @param code
	 * @return
	 * @throws Exception
	 */
	public Rule findByCodeRule(String code) throws Exception {
		// TODO Auto-generated method stub
		return ruleMapper.findByCodeRule(code);
	}

}
